Object.prototype.c = 3
let obj = {
  a: 1,
  b: {
    n: 2
  }
}

function deepClone(obj) {
  let newObj = {}
  
  for (let key in obj) {
    if (obj.hasOwnProperty(key)) {

      if (typeof obj[key] === 'object' && obj[key] !== null) {
        newObj[key] = deepClone(obj[key]);
      } else {
        newObj[key] = obj[key]
      }
      
    }
  }
  return newObj
}

let obj2 = deepClone(obj);
obj.b.n = 20

console.log(obj2);
